<!DOCTYPE html>
<html lang="en">

<head>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>肉品溯源商城后台管理系统</title>
    <link href="/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="/vendor/metisMenu/metisMenu.min.css" rel="stylesheet">
    <link href="/vendor/datatables-plugins/dataTables.bootstrap.css" rel="stylesheet">
    <link href="/vendor/datatables-responsive/dataTables.responsive.css" rel="stylesheet">
    <link href="/dist/css/sb-admin-2.css" rel="stylesheet">
    <link href="/vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">

</head>

<body>

    <div id="wrapper">
		<#include "shopMenu.ftl">
        <div id="page-wrapper">
            <div class="row">
				&nbsp;
            </div>
            <!-- /.row -->
            <div class="row">
                <div class="col-lg-12">
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <label><h3>商品模块</h3></label>&nbsp;&nbsp;&nbsp;&nbsp;
                            <a href='add' class='btn btn-default'
                              <#if (size >= 2) > disabled="disabled" onclick="return false;"</#if>
                            >新增热门商品信息</a>
                            <p>热门商品最多添加2条信息</p>
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <table width="100%" class="table table-striped table-bordered table-hover" id="dataTables-example">                  
                                <thead>
                                    <tr>
                                        <th>产品一编号</th>
                                        <th>产品一链接</th>
                                        <th>产品二编号</th>
                                        <th>产品二链接</th>
                                        <th>产品三编号</th>
                                        <th>产品三链接</th>

                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody>
									<#list hotProducts as hot>
										<tr class="odd gradeX">
                                            <td>${hot.propic.productId}</td>
											<td>
                                                <img style="max-width: 50px;max-height: 50px;" src="${hot.propic.url}">
                                            </td>
                                            <#list hot.productes as product>
                                                <td>${product.productid}</td>
                                                <td>
                                                    <img style="max-width: 50px;max-height: 50px;" src="${product.imagesrc}">
                                                </td>
                                            </#list>
											<td>
												<a href="delete?id=${hot.id}" onclick="if(confirm('确定删除?')==false)return false;">删除</a>
											</td>
										</tr>
									</#list>
                                </tbody>
                            </table>
                        </div>
                        <!-- /.panel-body -->
                    </div>
                    <!-- /.panel -->
                </div>
                <!-- /.col-lg-12 -->
            </div>
            <!-- /.row -->
            <div class="row">
                
                
            
            
            </div>
            <!-- /.row -->
        </div>
        <!-- /#page-wrapper -->

    </div>
    <!-- /#wrapper -->
    <script src="/vendor/jquery/jquery.min.js"></script>
    <script src="/vendor/bootstrap/js/bootstrap.min.js"></script>
    <script src="/vendor/metisMenu/metisMenu.min.js"></script>
    <script src="/vendor/datatables/js/jquery.dataTables.min.js"></script>
    <script src="/vendor/datatables-plugins/dataTables.bootstrap.min.js"></script>
    <script src="/vendor/datatables-responsive/dataTables.responsive.js"></script>
    <script src="/dist/js/sb-admin-2.js"></script>
    <script>
    $(document).ready(function() {
        $('#dataTables-example').DataTable({
            responsive: true
        });
    });
    </script>
    <script type="text/javascript">
			function delete1(id) {
				$.ajax({
					type:'post',
					url:'delete',
					data:{
					    id : id
					},
					success:function (data) {
						if(data.code == 0){
						    window.location.reload();
						}else{
						    alert("删除失败");
						}
                    }
				});
            }
	</script>

</body>

</html>
